#ifndef CLIENT_H
#define CLIENT_H


#include <QMainWindow>
#include <poker.h>
#include <QEvent>
#include <centerpanelbase.h>
#include <dealcardcenterpanel.h>
#include <tributecenterpanel.h>
namespace Ui {
class Client;
}
class Client : public QMainWindow
{
    Q_OBJECT

public:
    explicit Client(QWidget *parent = nullptr);
    bool event(QEvent* event);
    void init();
    void setPoker(int num[]);//设置所有牌
    ~Client();
    //set get
    bool getCan_out_poker() const;
    bool setCan_out_poker(bool) const;
//protected:
//    bool eventFilter(QObject* watched,QEvent * event);
//    void mousePressEvent(QMouseEvent * event);
public slots:
    void changeState(play_state state);
private:
    Ui::Client *ui;
    //牌
    int mark[54];//记录已知的牌
    QVector<Poker*> all_poker;//所有的牌
    QVector<Poker*> other_poker;//其他人的牌
    QVector<Poker*> own_poker;//自己的牌

    //个数
    int last_number;//上家牌个数
    int next_number;//下家牌个数

    //进贡状态
    QVector<player_type> need_tributer;//需要进贡的玩家
    player_type win;//上回合的胜者，被进供者
    //六种状态
    CenterPanelBase *find_room;//寻找房间
    CenterPanelBase *deal_card;//发牌
    CenterPanelBase *prepare;//准备阶段
    CenterPanelBase *tribute;//进贡阶段
    CenterPanelBase *play;//运行阶段
    CenterPanelBase *finish;//结算阶段
};
#endif // CLIENT_H
